using namespace System::Windows::Forms;

#ifndef NODE_H
#define NODE_H
    #pragma once
    #include <cstddef>//NULL
    #include <iostream>
    using namespace std;

    template<class TYPE>
    class Node
    {
    public:
        Node();
        Node(TYPE data);
        ~Node();

        void setData(TYPE data);
        TYPE getData();

        void setNext(Node<TYPE>* next);
        Node<TYPE>* getNext()const;
        Node<TYPE>*& getNext();

        void setPrevious(Node<TYPE>* previous);
        Node<TYPE>* getPrevious()const ;
        Node<TYPE>*& getPrevious();

    private:
        TYPE data;
        Node<TYPE>* next;
        Node<TYPE>* previous;
    };
    template<class TYPE>
    Node<TYPE>::Node()
    {
        this->data = 0;
        this->next = NULL;
        this->previous= NULL;
    }
    template<class TYPE>
    Node<TYPE>::Node(TYPE data)
    {
        this->data = data;
        this->next = NULL;
        this->previous= NULL;
    }
    template<class TYPE>
    Node<TYPE>::~Node()
    {

    }
    template<class TYPE>
    void Node<TYPE>::setData(TYPE data)
    {
        this->data = data;
    }
    template<class TYPE>
    TYPE Node<TYPE>::getData()
    {
        return this->data;
    }
    template<class TYPE>
    void Node<TYPE>::setNext(Node<TYPE>* next)
    {
        this->next =next;
    }
    template<class TYPE>
    Node<TYPE>* Node<TYPE>::getNext()const
    {
        return this->next;
    }
    template<class TYPE>
    Node<TYPE>*& Node<TYPE>::getNext()
    {
        return this->next;
    }
    template<class TYPE>
    void Node<TYPE>::setPrevious(Node<TYPE>* previous)
    {
        this->previous = previous;
    }
    template<class TYPE>
    Node<TYPE>* Node<TYPE>::getPrevious()const
    {
        return this->previous;
    }
    template<class TYPE>
    Node<TYPE>*& Node<TYPE>::getPrevious()
    {
        return this->previous;
    }
#endif // NODE_H

